package com.gm.springboot.service.impl;

import com.github.pagehelper.PageHelper;
import com.gm.springboot.bean.Manga;
import com.gm.springboot.mapper.MangaMapper;
import com.gm.springboot.service.MangaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: 阮渝轩
 * @Date: 2020/7/4 11:01
 * @Version 1.0
 */
@Service
public class MangaServiceImpl implements MangaService {
    @Autowired
    MangaMapper mangaMapper;
    @Override
    public List<Manga> findMangaAll(Integer page, Integer size) {
        PageHelper.startPage(page,size);
        return this.mangaMapper.findMangaAll();
    }

    @Override
    public int delManga(Integer mid) {
        return this.mangaMapper.delManga(mid);
    }

    @Override
    public int addManga(Manga manga) {
        return this.mangaMapper.addManga(manga);
    }

    @Override
    public Manga findMangaById(Integer mid) {
        return this.mangaMapper.findMangaById(mid);
    }

    @Override
    public int updManga(Manga manga) {
        return this.mangaMapper.updManga(manga);
    }
}
